package com.zjinyin.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel(" 用户信息 ")
public class User {
    private Long id;

    @ApiModelProperty("用户名")
    private String username;

    @JsonIgnore // 不参与序列化, 不从 Java 字符串转为 Jason 字符串
    private String password;

    @ApiModelProperty("用户昵称")
    private String nickname;

    @ApiModelProperty("用户手机号")
    private String phoneNum;

    @ApiModelProperty("用户邮箱")
    private String email;

    @ApiModelProperty("用户性别")
    private Byte gender;

    @JsonIgnore // 不参与序列化, 不从 Java 字符串转为 Jason 字符串
    private String salt;

    @ApiModelProperty("用户头像地址")
    @JsonInclude(JsonInclude.Include.ALWAYS) // 强制参与序列化, 为帖子的展示中头像设置做准备
    private String avatarUrl;

    @ApiModelProperty("用户帖子数量")
    private Integer articleCount;

    @ApiModelProperty("当前用户是否为管理员")
    private Byte isAdmin;

    @ApiModelProperty("用户简介")
    private String remark;

    @ApiModelProperty("用户状态")
    private Byte state;

    @JsonIgnore // 不参与序列化, 不从 Java 字符串转为 Jason 字符串
    private Byte deleteState;

    @ApiModelProperty("用户注册日期")
    private Date createTime;

    @ApiModelProperty("用户更新时间")
    private Date updateTime;

}